# Makefile
# David Grant, 2004
# Irene Huang, 2010/05/03 
# Mikhail Zakharov, 2010/05/11

#where all the headders are
INC=-I../common/
DEFINES+=-D_GDB_

ifeq ($(CFSERVER), YES)
DEFINES+=-D_CFSERVER_
endif


#enable trace output on gdb - requires pritnf
#DEFINES+=-DGTRACE

#optimization level
OPT=-O3

OBJS=coldfire-stub.o gdb_uart.o gdb_queue.o setjmp.o

CFLAGS=-Wall $(OPT) -Werror -m5307 -pipe -nostdlib ${INC} ${DEFINES} 
CC=m68k-elf-gcc
AR=m68k-elf-ar
ARFLAGS=cr

default:libgdb

libgdb.a: $(OBJS)
	$(AR) $(ARFLAGS) libgdb.a $(OBJS) 
libgdb_cf.a: $(OBJS)
	$(AR) $(ARFLAGS) libgdb_cf.a $(OBJS) 

libgdb:
	make clean
	make libgdb.a
libgdb_cf:
	make clean
	make CFSERVER=YES libgdb_cf.a

clean:
	rm -rf *.o
